import request from '@/utils/request'

function getRTimeWea(pos) {
  return request({
    method: 'get',
    url: 'https://devapi.qweather.com/v7/weather/now',
    params: {
      location: pos,
      key: '461478a0e8e44088ae16ad7395540fe9'
    }
  })
}

function get7DWea(pos) {
  return request({
    method: 'get',
    url: 'https://devapi.qweather.com/v7/weather/7d',
    params: {
      location: pos,
      key: '42ee1b2b6f664647a9d5cfa192da0d27'
    }
  })
}
function getCityInfo(pos) {
  return request({
    method: 'get',
    url: 'https://geoapi.qweather.com/v2/city/lookup',
    params: {
      location: pos,
      key: '461478a0e8e44088ae16ad7395540fe9'
    }
  })
}

function getTipInfo(pos, type) {
  return request({
    method: 'get',
    url: 'https://devapi.qweather.com/v7/indices/1d',
    params: {
      type,
      location: pos,
      key: '42ee1b2b6f664647a9d5cfa192da0d27'
    }
  })
}
export { get7DWea, getCityInfo, getRTimeWea, getTipInfo }
